package com.itheima.homework.blockQueue;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * 生产者消费者阻塞队列代码逻辑 / 自定义连接池各种拒绝策略 / CountDownLatch案例练习
 */
public class Test {
    public static void main(String[] args) {
        ArrayBlockingQueue<String> abq = new ArrayBlockingQueue<>(1);
        Lock lock = new ReentrantLock();
        Thread tr1 = new Thread(new Foodie(abq));
        Thread tr2 = new Thread(new Cooker(abq));
        tr1.start();
        tr2.start();
    }
}
